from abc import ABC, abstractmethod
from typing import Dict, Any
from src.data.structures import BinocularImagePair


class ICamera(ABC):
    @abstractmethod
    def open(self) -> bool: ...
    @abstractmethod
    def close(self) -> None: ...
    @abstractmethod
    def grab(self) -> BinocularImagePair: ...
    @property
    @abstractmethod
    def properties(self) -> Dict[str, Any]: ...
    def onFrameHook(self, pair: BinocularImagePair) -> None:
        """用户可重写：预览、保存、立体匹配"""
        pass
